module diansha {

	/**
	 * 获取属性返回的对象
	 */
	export class NUMlast {
		max: diansha.shuzi;
		little_level: diansha.shuzi;//小及
		big_level: diansha.shuzi;//大及
	}


	export class NUM {
		private static D: NUM = null;
		public one_time_qi: diansha.shuzi;//每次吸取的值
		public little_level: diansha.shuzi;//小及
		public big_level: diansha.shuzi;//大及
		public max: diansha.shuzi;//当前最大存储
		private little_i: diansha.shuzi;//小及升系数
		private big_i;//大及升系数

		public constructor() {
			this.one_time_qi = shuzi_factory.getinstance().get(35, "n")
			this.little_level = shuzi_factory.getinstance().get(1, "n")
			this.big_level = shuzi_factory.getinstance().get(1, "n")
			this.max = shuzi_factory.getinstance().get(100, "n")
			this.little_i = shuzi_factory.getinstance().get(2, "n")
			this.big_i = shuzi_factory.getinstance().get(10, "n")
		}
		public static getinstance(): NUM {
			if (this.D == null) {
				this.D = new NUM();
			}
			return this.D;
		}

		/**
		 * up全套
		 * 
		 */
		public up(): diansha.NUMlast {
		this.little_level=	this.little_level.add(shuzi_factory.getinstance().get(1, "n"));

			if (this.little_level.num >= 10) {
				this.big_level = this.big_level.add(shuzi_factory.getinstance().get(1, "n"))
			}
			let s;
			if (this.little_level.num != 10) {
				s = this.max.cheng(this.little_i)
				console.log(this.max)
			} else {
				s = this.max.cheng(this.big_i)
				this.little_level = shuzi_factory.getinstance().get(1, "n")
			}
			this.max=s;
			let ss = new diansha.NUMlast()
			ss.big_level = this.big_level
			ss.little_level = this.little_level
			ss.max =s;
			return ss;
		}
	}
}